@import 'banners/successful-merge';
@import 'banners/merge-conflicts';
@import 'banners/successful-rebase';
@import 'banners/rebase-conflicts';
@import 'banners/update-available';

.banner {
  $banner-height: 30px;
  height: $banner-height;
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  align-content: center;
  align-items: center;
  justify-content: space-between;
  padding-left: var(--spacing);

  // Prevents the notification banner from decreasing its height
  // when a large diff is rendered.
  flex: none;

  .contents {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    align-content: center;
    justify-content: left;
    align-items: center;
  }
  .close {
    display: flex;
    flex-shrink: 0;
    flex-grow: 0;
    width: 16px;
    height: 16px;
    margin-right: var(--spacing);
    margin-left: var(--spacing);
    background: transparent;

    color: var(--text-secondary-color);

    &:hover {
      color: var(--text-color);
    }

    &:focus {
      outline: 0;
    }
  }

  // animations for entering and leaving
  &.banner-enter {
    height: 0px;
    opacity: 0;

    &.banner-enter-active {
      height: $banner-height;
      opacity: 1;
      transition: height 300ms ease-in-out, opacity 200ms ease-in 300ms;
    }
  }

  &.banner-exit {
    height: $banner-height;
    opacity: 1;

    &.banner-exit-active {
      height: 0px;
      opacity: 0;
      transition: height 225ms ease-in-out 175ms, opacity 175ms ease-in;
    }
  }
}
